/*
 * kbdctl.h
 *
 *  Created on: Mar 12, 2013
 *      Author: ismith
 */

#ifndef KBDCTL_H_
#define KBDCTL_H_

#include "global.h"

#define BUFFER_LENGTH 16

typedef struct {
	Byte buffer[BUFFER_LENGTH];
	int read_position;
	int write_position;
	Bit buffer_full;
} KbdctlStr;

typedef KbdctlStr * KbdctlPtr;

KbdctlPtr kbdctl_new(void);
void kbdctl_initialize(KbdctlPtr kbd);
void kbdctl_free(KbdctlPtr kbd);

void kbdctl_writechar(KbdctlPtr kbd, Byte character);
Bit kbdctl_haschar(KbdctlPtr kbd);
Byte kbdctl_readchar(KbdctlPtr kbd);

#endif /* KBDCTL_H_ */
